//
// Created by wkm on 2023-12-10.
//

#ifndef MYSYSTEMCLEARNING_MONITOR_H
#define MYSYSTEMCLEARNING_MONITOR_H

#include <math.h>
#include "systemc.h"
#include "../../ModelingExample/Factorial/fac.h"

SC_MODULE(monitor) {
    sc_in<bool> clk, done;
    sc_out<bool> reset, start;
    sc_out<sc_uint<DATA_SIZE>> data;
    sc_in<sc_uint<OUT_SIZE>> fac_out, exp_out;

    void prc_monitor();

    enum state_type {
        reset_state, start_state, apply_data_state, wait_result_state
    };

    sc_signal<state_type> next_state;

    SC_CTOR(monitor) {
        SC_THREAD(prc_monitor);
        sensitive_neg << clk;
        sensitive << done;
    }
};

#endif //MYSYSTEMCLEARNING_MONITOR_H
